﻿<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/skin/default/skin.css" id="skin"/>
    <link href="../css/H-ui.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../css/Hui-iconfont/1.0.8/iconfont.css"/>
    <script src='../js/jquery-1.11.2.min.js'></script>
    <script type="text/javascript" src="../js/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../js/postJson.js"></script>
    <script type="text/javascript" src="../js/jquery.contextmenu.r2.js"></script>
    <script type="text/javascript" src="../js/H-ui.min.js"></script>
    <script type="text/javascript" src="../js/root.js"></script>
</head>
<body>
<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container-fluid cl">
            <a class="logo navbar-logo f-l mr-10 hidden-xs urlName" href=""></a>
            <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
            <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                <ul class="cl">
                    <li class="dropDown dropDown_hover" id="name"><a href="##" class="dropDown_A"><span></span><i
                            class="fa fa-angle-down"></i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a data-href="/sysUser/userUpdatePassWord" data-title="自身密码修改">修改密码</a></li>
                            <li class="outLogin"><a>退出</a></li>
                        </ul>
                    </li>
                    <li id="Hui-msg">
                        <a href="#" title="消息">
                            <span class="badge badge-danger">1</span>
                            <i class="fa fa-envelope-o" style="font-size:18px"></i>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<div class="Hui-aside">
    <input runat="server" id="divScrollValue" type="hidden" value=""/>

    <div class="menu_dropdown bk_2">

    </div>
</div>
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a>
</div>
<div class="Hui-article-box">
    <div id="Hui-tabNav" class="Hui-tabNav hidden-xs">
        <div class="Hui-tabNav-wp">
            <ul id="min_title_list" class="acrossTab cl">
                <li class="active"><span title="我的桌面">我的桌面</span><em></em></li>
            </ul>
        </div>
        <div class="Hui-tabNav-more btn-group">
            <a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:;">
                <i class="Hui-iconfont">&#xe6d4;</i>
            </a>
            <a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:;">
                <i class="Hui-iconfont">&#xe6d7;</i>
            </a></div>
    </div>
    <div id="iframe_box" class="Hui-article" data-userid="">
        <div class="show_iframe">
            <div style="display:none" class="loading"></div>
            <iframe scrolling="yes" frameborder="0"></iframe>
        </div>
    </div>
</div>
<script type="text/javascript">

    $(function () {
        $(document).ready(function () {
            var url = "/sys/userInfo";
            $.ajax({
                url: url,
                type: "get",
                async: false,
                dataType: 'json',
                success: function (msg) {
                    // console.log("-------------")
                     // console.log(JSON.stringify(msg.data))
                    // console.log("-------------")
                    $("#iframe_box").attr("data-userid", JSON.stringify(msg.data.id))
                    $(".dropDown_A span").text(msg.data.name)
                },
                error:function(XMLHttpRequest,textStatus,errorThrown){
                    var XmlStatus = XMLHttpRequest.status
//                         console.log(XMLHttpRequest.status)
                    if(XmlStatus==401){
                        alert(XmlError.error401)
                        parent.window.location.href = "login"
                    }
                    if(XmlStatus==403){
                        alert(XmlError.error403)
                    }
                }
            })
        })

        //读取配置文件 系统名称
        function urlName() {
            var url ="/sys/urlName";

            $.ajax({
                url: url,
                type: "get",
                async: false,
                dataType: 'json',
                success: function (msg) {
                    if(msg.success==true){
                        $('title').text(msg.data)
                        $(".urlName").text(msg.data)
                    }else{
                        parent.layer.msg(msg.data,{icon:2,time:5000});
                    }
                },
                error:function(XMLHttpRequest,textStatus,errorThrown){
                    var XmlStatus = XMLHttpRequest.status
//                         console.log(XMLHttpRequest.status)
                    if(XmlStatus==401){
                        alert(XmlError.error401)
                        parent.window.location.href = "login"
                    }
                    if(XmlStatus==403){
                        alert(XmlError.error403)
                    }
                }
            });

        };
        // urlName();

        function tabs() {
            var listTab = [];
            var url = "/sys/modular";

            $.ajax({
                url: url,
                type: "get",
                async: false,
                dataType: 'json',
                success: function (msg) {
                    var htmlString = '';
                    for (var key in msg.data) {
                        listTab.push(msg.data[key])
                    }
				// console.log(JSON.stringify(msg))
                    $.each(listTab, function (i, n) {
                        if (n.parentId == 0) {
                            htmlString += '<dl>'
                            // htmlString += '<dt data-mark="' + n.id + '"><i class="fa fa-home"></i>' + n.name + '<i class="fa fa-menu_dropdown-arrow"></i></dt>'
                            htmlString += '<dt data-mark="' + n.id + '"><i class="Hui-iconfont">&#xe616;</i>' + n.name + '<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>'
                            htmlString += '<dd>'
                            htmlString += '<ul>'
                            $.each(listTab, function (i2, n2) {
                                if (n.id == n2.parentId) {
                                    htmlString += '<li><a data-href="' + n2.url + '" data-title="' + n2.name + '" href="javascript:void(0)">' + n2.name + '</a></li>'
                                }
                            })
                            htmlString += '</ul>'
                            htmlString += '</dd>'
                            htmlString += '</dl>'
                        }

                    })
                    $(".menu_dropdown ").append(htmlString)

                },
                error:function(XMLHttpRequest,textStatus,errorThrown){
                    var XmlStatus = XMLHttpRequest.status
//                         console.log(XMLHttpRequest.status)
                    if(XmlStatus==401){
                        alert(XmlError.error401)
                        parent.window.location.href = "login"
                    }
                    if(XmlStatus==403){
                        alert(XmlError.error403)
                    }
                }
            });

        };
        tabs();

        $(".outLogin").click(function () {
            var url = "/sys/dologout";
            $.ajax({
                url: url,
                type: "get",
                async: false,
                dataType: 'json',
                success: function (data) {
                    window.location.href = "login"
                },
                error:function(XMLHttpRequest,textStatus,errorThrown){
                    var XmlStatus = XMLHttpRequest.status
//                         console.log(XMLHttpRequest.status)
                    if(XmlStatus==401){
                        alert(XmlError.error401)
                        parent.window.location.href = "login"
                    }
                    if(XmlStatus==403){
                        alert(XmlError.error403)
                    }
                }
            })
        })
    })
</script>
<script type="text/javascript" src="../js/H-ui.js"></script>
</body>
</html>